package dper.study.codes.common.simulation4jvmstudy;


import java.lang.ref.SoftReference;

/**
 * Created by leichen on 2017/5/18.
 */
public class SoftRefSimulation {
    //-XX:SoftRefLRUPolicyMSPerMB=0 -Xms32M -Xmx32M
    public static void main(String[] args){

        System.out.println("Start");

        SoftReference<SoftRefSimulation> sr = new SoftReference<SoftRefSimulation>(new SoftRefSimulation());
        System.out.println(sr.get());
        System.gc();
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println(sr.get());
        System.out.println("Stop");
    }
}
